import React from 'react';
import { SearchForm, Gap, Table } from '@/components';
import { columns, fields } from './helper';
import { useMyTable } from '@/hooks';
import { getDataQueryList } from './service';

const DataQuery = () => {
  const { search, ...restAttrs } = useMyTable({
    service: getDataQueryList,
    format: false,
  });
  return (
    <>
      <SearchForm fields={fields} query={search} labelWidth={105} />
      <Gap />
      <Table
        title={`数据查询列表`}
        rowKey={'id'}
        scroll={{
          y: 'calc(100vh - 294px)',
        }}
        columns={columns}
        {...restAttrs}
      />
    </>
  );
};

export default DataQuery;
